//
//  BCStuffSecondTableCell.m
//  BangcaiBuy
//
//  Created by lsy on 16/6/16.
//  Copyright © 2016年 BCB. All rights reserved.
//

#import "BCStuffSecondTableCell.h"

@interface BCStuffSecondTableCell ()
{
    UILabel *titleLabel;
}

@end

@implementation BCStuffSecondTableCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView
{
    titleLabel = [[UILabel alloc] init];
    [self.contentView addSubview:titleLabel];
 
}

- (void)setChoosed:(BOOL)choosed
{
    _choosed = choosed;
    [self layoutSubviews];
}

- (void)layoutSubviews
{
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.and.left.and.right.equalTo(self.contentView);
        make.bottom.mas_equalTo(1);
    
    }];
    titleLabel.text = self.title;
    titleLabel.font = [UIFont systemFontOfSize:15];
    titleLabel.layer.borderWidth = 1;
    titleLabel.layer.borderColor = [UIColor colorWithRed:0.217  green:0.648  blue:0.374 alpha:1].CGColor;
    titleLabel.textAlignment = NSTextAlignmentCenter;
    if (!_choosed) {
        titleLabel.textColor = [UIColor blackColor];
        titleLabel.backgroundColor = [UIColor clearColor];
    }else
    {
        titleLabel.textColor = [UIColor whiteColor];
        titleLabel.backgroundColor = [UIColor colorWithRed:0.212  green:0.656  blue:0.366 alpha:1];

    }

}

@end
